<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
        <link href="<?php echo Yii::app()->baseUrl."/assets/css/bootstrap.min.css" ?>" rel="stylesheet" />	
        <link href="<?php echo Yii::app()->baseUrl."/assets/font/font-awesome/css/font-awesome.min.css" ?>" rel="stylesheet" />	
        
        <link rel='stylesheet' href="<?php echo Yii::app()->baseUrl."/assets/main/reset.css?v=635435186962986934" ?>" />
        <link rel='stylesheet' href="<?php echo Yii::app()->baseUrl."/assets/main/main.css?v=635435186962986934"?>" />
        <link rel='stylesheet' href="<?php echo Yii::app()->baseUrl."/assets/main/custome.css?v=635435186962986934"?>" />
        <link rel='stylesheet' href="<?php echo Yii::app()->baseUrl."/assets/main/alotro.css"?>" />
        <link rel='stylesheet' href="<?php echo Yii::app()->baseUrl."/assets/main/alotro.index.css"?>" />
        <link rel="stylesheet" href="<?php echo Yii::app()->baseUrl?>/assets/css/bootstrapValidator.min.css"/>
<!--                <link href="<?php echo Yii::app()->baseUrl."/assets/css/jquery-ui.css" ?>" rel="stylesheet" />	-->
        
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/jquery-1.8.2.min.js?v=635435186962986934"?>"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/jquery.cookie.min.js?v=635435186962986934"?>"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/jquery.validate.min.js?v=635435186962986934"?>"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/jquery.unobtrusive-ajax.min.js?v=635435186962986934"?>"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/jquery.validate.unobtrusive.min.js?v=635435186962986934"?>"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/jquery.autocomplete.js?v=635435186962986934"?>"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/jquery.blockUI.js?v=635435186962986934"?>"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/json2.js?v=635435186962986934"?>"></script>
        
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/common.js?v=635435186962986934"?>"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/jquery.countdown.min.js?v=635435186962986934"?>"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/mypopup.js?v=635435186962986934"?>"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/search.js?v=635435186962986934"?>"></script>
        <!--<script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/event.js?v=635435186962986934"?>"></script>-->
        
        <!--alotro script-->
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/alotro.index.js"?>"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/main/alotro.layout.js"?>"></script>
        
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl?>/assets/js/jquery-1.11.1.min.js"></script>
                <!--<script type="text/javascript" src="<?php echo Yii::app()->baseUrl?>/assets/js/jquery-ui.js"></script>-->
        
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl?>/assets/js/bootstrapValidator.min.js"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/js/bootstrap.min.js" ?>"></script>
        
        <!--Pajinate pagination js-->
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl."/assets/pagination/jquery.pajinate.js"?>"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                $('#salepoint').pajinate({
                    items_per_page : 6,
                    item_container_id : '#ul_list_salepoint',
                    nav_panel_id : '.alt_page_navigation'
                });
            });	
        </script>
        <!--my custom-->
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl ?>/assets/js/mycustom.js"> </script>
        <link rel="stylesheet" type="text/css" media="screen" href="<?php echo Yii::app()->baseUrl ?>/assets/css/mycustom.css">
        
        <title>Thương Hiệu</title>
    </head>
    <body> 
        <!--header-->
        <div class="navbar navbar-fixed-top" role="navigation">
            <div class="container">
                <div class="navbar-header">  
                    <a class="navbar-brand" href="#">
                        <img src="<?php echo Yii::app()->baseUrl;?>/assets/images/logo.png" style="height: 20px;" />
                    </a>
                    <a class="navbar-brand">ORDER SYSTEM</a>
                </div>
                <div class="navbar-collapse collapse" data-sb-width="200px" id="navbar-slide" style="margin-right: 15px">
                    <ul class="nav navbar-nav navbar-right" id="ul-navbar-slide">
                        <?php if (isset(Yii::app()->session['login']) && Yii::app()->session['login']) { ?>
                        <li class="list">
                            <a href="javascript: void;"class="dropdown-toggle link acc-info" data-toggle="dropdown" title="<?php echo Yii::app()->session['name']?>">
                                Chào <?php echo Yii::app()->session['name']?>
                                <i class="fa fa-caret-down"></i>
                            </a>
                            <ul class="dropdown-menu" aria-labelledby="dropdownMenu1" role="menu" style="display: none;">
                                <li class="arrow">
                                    <div></div>
                                </li>
                                <li role="presentation">
                                    <a role="menuitem" class="acc-name" tabindex="1" href="#">
                                        <span style="font-weight: bold"><?php echo Yii::app()->session['name']?></span>
                                    </a>
                                </li>
                                <li class="divider" role="presentation"></li>
                                <?php if (empty($row)) {?>
                                <li role="presentation" >
                                    <a role="menuitem" tabindex="2" href="<?php echo Yii::app()->baseUrl;?>/index.php/site/salepointadd">
                                        Tạo Thương Hiệu</a></li>
                                <?php } elseif (Yii::app()->session['saleId']) {;?>
                                <li role="presentation" >
                                    <a role="menuitem" tabindex="2" href="<?php echo Yii::app()->baseUrl;?>/index.php/site/salepoint">
                                        Quản lý sản phẩm</a></li>
                                <?php }?>
                                <li role="presentation" >
                                    <a role="menuitem" tabindex="3" href="<?php echo Yii::app()->baseUrl;?>/index.php/site/logout">
                                        Đăng xuất</a></li>
                                <script>
                                    initPopupMenu('li.list', 'ul.dropdown-menu', 500);
                                </script>
                            </ul>
                        </li>
                        <?php
                             } else {
                        ?>
                        <li><a class="link" style="padding-right: 45px" href="#" data-toggle="modal" data-target="#registrationModal">Đăng ký</a></li>
                        <li><a class="link" href="#" data-toggle="modal" data-target="#loginModal">Đăng nhập</a></li>
                       <?php }?>
                    </ul>
                </div>
            </div>
        </div>
        <!--search-->
        <div class="homebg">
            <div id="pics" class="img-responsive hidden-xs">
                <div class="photoslide img-responsive">
                    <img src="<?php echo Yii::app()->baseUrl?>/images/image5.jpg" alt="Picture 1" class="image-slide img-responsive" />
                </div>
                <div class="photoslide">
                    <img src="<?php echo Yii::app()->baseUrl?>/images/image6.jpg" alt="Picture 2" class="image-slide img-responsive"/>
                </div>
                <div class="photoslide">
                    <img src="<?php echo Yii::app()->baseUrl?>/images/image5.jpg" alt="Picture 3" class="image-slide img-responsive"/>
                </div>
                <div class="photoslide">
                    <img src="<?php echo Yii::app()->baseUrl?>/images/image6.jpg" alt="Picture 4" class="image-slide img-responsive" />
                </div>
            </div>
            <div class="search-area">
                <div class="search-page-container">
                    <div class="row">
                        <div class="col-lg-10 col-md-10 col-sm-12 col-xs-10">
                            <div id="blob-bg"></div>
                            <h1 class="text-special">Bạn muốn mua sắm?
                            </h1>
                            <h2 class="text-special2">Hãy chọn địa chỉ nơi bạn muốn mua sắm.
                                <br />
                                Chúng tôi có hàng trăm cửa hàng và hàng ngàn khuyến mãi cho bạn.
                            </h2>
                            <div class="search-form">
                                <form id ="idSearch" method="post" enctype="multipart/form-data" action="">
                                    <input type="hidden" name="mode" value="search"/>
                                    <div class="form-group inline-search" id="area">
                                        <select class="form-control" name="city" id="SalePointForm_area">                                            
                                            <option>Chọn thành phố</option>
                                            <option value="1">Hồ Ch&#237; Minh</option>
                                            <option value="2">H&#224; Nội</option>
                                        </select>
                                    </div>
                                    <div class="form-group inline-search">
                                        <select class="form-control" name="district" id="SalePointForm_district">     
                                            <option value="0">Chọn Quận</option>
                                        </select>
                                    </div>
                                    <div class="form-group inline-search">
                                        <select class="form-control" name="type_business">
                                            <option value="0">Chọn loại cửa hàng</option>
                                            <?php foreach ($data_business as $key => $value) {
                                                $key++;
                                                echo "<option value='$key'>".$value['name']."</option>";
                                                }?>
                                        </select>
                                    </div>
                                    <div class="form-group inline-search">
                                        <button type="submit" class="btn btn-info"><i class="fa fa-search" style="margin-right: 5px;"></i>Tìm cửa hàng</button>
                                    </div>
<!--                                    <div class="form-group" style="float: left;">
                                        <button type="submit" class="btn btn-danger btn-map"><i class="fa fa-globe" style="margin-right: 5px;"></i>Xem bản đồ</button>
                                    </div>-->
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--menu-->
        <div class="menu-bar">
            <div class="container" style="">
                <a class="logo_footer" style=" margin-top: 13px"></a>
                <ul style="float: right; margin: 0px">
                    <?php foreach ($data_business as $key => $value): ?>
                    <li class="inline2">
                        <a href=".?id=<?php echo $key?>" style="padding: 20px 15px; text-decoration: none; color: #ffffff" 
                           onMouseOver="this.style.background='#660000'"
                           onMouseOut="this.style.backgroundColor='#F00';
                               this.style.background='url(assets/main/images/index.png) no-repeat scroll right center transparent'"
                           >
                            <?php echo $value['name']?>
                        </a>
                    </li>
                    <?php endforeach;?>
                </ul>
            </div>
        </div>
        <!--body-->
        <div class="body">
            <!--slideBanner-->
            <div class="container">
                <script>
                    jQuery(document).ready(function ($) {
                        var rollingView = new RollingHotDealView(new HotDealView('.slideBanner', <?php 
                        foreach ($data as $key => $value) {
                        echo $value['id'];
                }?>));
                        rollingView.start(4000);
                    });
                </script>
                
                <div class="banner_big_div" style="min-height: 350px">
                    <div class="slideBanner">
                        <ul>
            <?php foreach ($data as $key => $value): 
                if ($key > 5) continue;
                ?>
                            <li>
                                <em>
                                    <a href="<?php echo Yii::app()->baseUrl?>/index.php/store/index?index=<?php echo $value['id']?>" target="_blank" title="Small Slide <?php echo $key?>">
                                        <img src="<?php echo Yii::app()->baseUrl;?>/files/<?php echo $value['sale_image'];?>" alt="" title=""
                                             style="width: 207px; height: 55px;" />
                                    </a>
                                    <span>&nbsp;</span>
                                </em>
                                <strong>
                                    <a href="<?php echo Yii::app()->baseUrl?>/index.php/store/index?index=<?php echo $value['id']?>" target="_blank" title="Big Slide <?php echo $key?>">
                                        <img src="<?php echo Yii::app()->baseUrl;?>/files/<?php echo $value['sale_image'];?>" 
                                             style="width: 779px; height: 346px; border: 1px solid #cccccc" alt="">
                                    </a>
                                    
                                </strong>
                                <a href="#" class="view_deal"></a>
                            </li>
                <?php endforeach;?>
                        </ul>
                    </div>
                </div>
            </div>
            <!--Cửa hàng uy tín-->
            <div class="container" style="margin-top: 40px">
                <span class="title_custom">Cửa hàng uy tín</span>
                <!--<span class="dash-title"></span>-->
                <div class="div_ul_list" id="div_ul_list_hp_popular_deal">
                    <ul class="ul_list_deal">
                    <?php 
                    for ($index = count($data_rating)-1; $index >= 0; $index--): 
                        if (count($data_rating)-$index - 1>= 3) {
                            continue;
                        }
                        ?>
                        <li>
                            <div class="a_deal">
                                <div class="bg_img">
                                    <a href="<?php echo Yii::app()->baseUrl?>/index.php/store/index?index=<?php echo $data_rating[$index]['id']?>">
                                        <img src="<?php echo Yii::app()->baseUrl?>/files/<?php echo $data_rating[$index]['sale_image']?>" alt="<?php echo $data_rating[$index]['sale_name']?>"/>
                                    </a>
                                    
                                    <div class="bg_deliver">
                                        <span class="cl_blue f_med">Cửa Hàng <?php echo $data_rating[$index]['sale_name']?></span>
                                        <span class="icon_de_voucher"></span>
                                    </div>
                                    <div class="bg_location">
                                        <span class="icon_location_deal"></span>
                                        <span class="cl_white distrist"><?php echo $data_rating[$index]['sale_address']?></span>
                                    </div>
                                    <a href="<?php echo Yii::app()->baseUrl?>/index.php/store/index?index=<?php echo $data_rating[$index]['id']?>" class="view_deal"></a>
                                </div>
                                <div class="info_deal">
                                    <h4 class="cl_black_5 title_deal">Honey Moon 3N2Đ tại Michelia Hotel 4 sao Nha Trang + ăn tối dsa dsa dsa dsa dsa dsa dsa ds adsa dsa</h4>
                                    <div class="info_deal_cont" style="width: 100%; height: 22px">
                                        <span class="icon_phone" style="margin-right: 5px"></span>
                                            <?php echo $data_rating[$index]['sale_mobile']?>
                                    </div>
                                    <div class="info_deal_cont" style="width: 100%;">
                                        <div class="dash"></div>
                                    </div>
                                    <div class="info_deal_cont" style="width: 100%; height: 22px; margin-top: 5px">
                                        <span class="icon_email" style="margin-right: 5px"></span>
                                        <?php echo $data_rating[$index]['sale_email']?>
                                    </div>
                                </div>
                            </div>
                        </li>
                            <?php endfor;?>                       
                    </ul>
                </div>
            </div>
            <!--thuong hieu-->
            <div class="container" id="salepoint">
                <?php 
                if (!isset($_GET['id'])) {
                        $row_array = 0;                        
                } else $row_array = $_GET['id'];
                $id_business = $data_business[$row_array]['id'];
                
                if (isset($_POST['mode']) && $_POST['mode'] == 'search') {
                    $name = "Kết Quả Tìm Kiếm";
                } else
                    $name = $data_business[$row_array]['name'];
                
                ?>
                <span class="title_custom"><?php echo $name?></span>
                <div class="alt_page_navigation" style=" float: right"></div>
                <div class="div_ul_list" id="div_ul_list_salepoint">
                    <ul class="ul_list_deal" id="ul_list_salepoint">
                    <?php 
                    if (is_array($data_search))
                        $data = $data_search;
                    foreach ($data as $key => $value): 
                        if (!is_array($data_search) && $value['sale_business'] != $id_business):
                            continue;
                        endif;
                        $data_search = '';?>
                        <li>
                            <div class="a_deal">
                                <div class="bg_img">
                                    <a href="<?php echo Yii::app()->baseUrl?>/index.php/store/index?index=<?php echo $value['id']?>">
                                        <img src="<?php echo Yii::app()->baseUrl?>/files/<?php echo $value['sale_image']?>" alt="<?php echo $value['sale_name']?>"/>
                                    </a>
                                    <div class="bg_deliver">
                                        <span class="cl_blue f_med">Cửa Hàng <?php echo $value['sale_name']?></span>
                                        <span class="icon_de_voucher"></span>
                                    </div>
                                    <div class="bg_location">
                                        <span class="icon_location_deal"></span>
                                        <span class="cl_white distrist"><?php echo $value['sale_address']?></span>
                                    </div>
                                    <a href="<?php echo Yii::app()->baseUrl?>/index.php/store/index?index=<?php echo $value['id']?>" class="view_deal"></a>
                                </div>
                                <div class="info_deal">
                                    <h4 class="cl_black_5 title_deal">Honey Moon 3N2Đ tại Michelia Hotel 4 sao Nha Trang + ăn tối</h4>
                                    <div class="info_deal_cont" style="width: 100%; height: 22px">
                                        <span class="icon_phone" style="margin-right: 5px"></span>
                                            <?php echo $value['sale_mobile']?>
                                    </div>
                                    <div class="info_deal_cont" style="width: 100%;">
                                        <div class="dash"></div>
                                    </div>
                                    <div class="info_deal_cont" style="width: 100%; height: 22px; margin-top: 5px">
                                        <span class="icon_email" style="margin-right: 5px"></span>
                                        <?php echo $value['sale_email']?>
                                    </div>
                                </div>
                            </div>
                        </li>
                            <?php endforeach;?>                       
                    </ul>
                </div>
            </div>
            <!--tin tức-->
            <div class="container">
                <span class="title_custom">Tin tức</span>
                <div class="div_ul_list" id="div_ul_list_news">
                    <ul class="ul_list_deal">
                <?php for ($i = count($data_news)-1; $i >= 0; $i--): 
                    if (count($data_news)-$i-1 >= 3):
                        continue;
                    endif;
                    ?>
                        <li>
                            <div class="a_news">
                                <div class="bg_img">
                                    <a href="">
                                        <img src="<?php echo Yii::app()->baseUrl?>/files/<?php echo $data_news[$i]['news_image']?>" 
                                             alt="<?php echo $data_news[$i]['news_title']?>" style="height: 250px;border: 1px solid #C8C8C8;"/>
                                    </a>                                    
                                </div>
                                <div class="info_deal">
                                    <h3 class="cl_black_5 title_deal" style="color: orange"><?php echo $data_news[$i]['news_title']?></h3>
                                    <h4 class="cl_black_5 title_deal" style="padding: 0px; height: 65px"><?php echo $data_news[$i]['news_description']?></h4>
                                </div>
                            </div>
                        </li>
                            <?php endfor;?>                       
                    </ul>
                </div>
            </div>        
            <!--tiện ích-->
            <div class="container">
                <div class="fast_deal_day_div">
                    <div class="fast_deal_day">
                        <div class="choice_nm">
                            <ul>
                                <li>
                                    <span class="nm_2"></span>
                                    <div class="nm_info">
                                        <span class="f_bold cl_blue title">Chi tiêu hiệu quả</span>
                                        <span class="content cl_black_2">Đa dạng sản phẩm &amp; dịch vụ<br/> Chất lượng cao với giá ưu đãi</span>
                                    </div>
                                </li>
                                <li>
                                    <span class="nm_3"></span>
                                    <div class="nm_info">
                                        <span class="f_bold cl_blue title">An tâm khi mua sắm</span>
                                        <span class="content cl_black_2">Thanh toán tiền khi nhận hàng<br />Đổi trả thoải mái</span>
                                    </div>
                                </li>
                                <li class="end">
                                    <span class="nm_4"></span>
                                    <div class="nm_info">
                                        <span class="f_bold cl_blue title">Dịch vụ chu đáo</span>
                                        <span class="content cl_black_2">Giao hàng nhanh trong 24h <br/> Hotline phục vụ cả T7 và CN</span>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!--footer-->
        <div class="footer_div">
            <div class="footer">
                <div class="col-l">
                    <ul>
                        <li class="help-footer intro_help">
                            <h6 class="cl_black_1 f_bold">Giới thiệu</h6>
                            <a rel="nofollow" class="f_thin cl_black_1" href="/nhom-mua-la-ai.html">Về chúng tôi</a>
                            <a rel="nofollow" class="f_thin cl_black_1" href="/hoi-dap.html">Hỏi đáp</a>
                            <a class="f_thin cl_black_1" href="/ho-chi-minh/cac-khuyen-mai-da-ban.html">Deal đã bán</a>
                            
                            <a class="f_thin cl_black_1" href="/tp-ho-chi-minh/gia-tot-gan-day/trang-1.html">Giá tốt gần đây</a>
                            <!--<a class="patner" href="/hop-tac-voi-nhom-mua.html"></a>-->
                        </li>
                        <li class="help-footer help_help">
                            <h6 class="cl_black_1 f_bold">Trợ giúp</h6>
                            <a rel="nofollow" class="f_thin cl_black_1" href="/quy-che-san-giao-dich.html">Quy chế sàn giao dịch </a>
                            <a rel="nofollow" class="f_thin cl_black_1" href="/chinh-sach-bao-mat-thong-tin.html">Chính sách bảo mật </a>
                            <a rel="nofollow" class="f_thin cl_black_1" href="/chinh-sach-thu-hoi-tra-san-pham.html">Chính sách thu hồi/đổi trả </a>
                            <a rel="nofollow" class="f_thin cl_black_1" href="/su-dung-voucher-nhom-mua.html">Sử dụng voucher</a>
                        </li>
                        <li class="help-footer hot_sp">
                            <h6 class="cl_black_1 f_bold">Hỗ trợ Khách hàng</h6>
                            <span class="icon_tele"></span>
                            <span class="txt_phone f_bold">1900 6617</span>
                            <span class="cl_black_4 time_sp">từ 8h-21h, kể cả Thứ 7-CN</span>
                            <ul class="ul_social">
                                <li>
                                    <a rel="nofollow" class="icon_face" href="https://www.facebook.com/" target="_blank"></a>
                                </li>
                                <li>
                                    <a rel="nofollow" class="icon_twitter" href="http://twitter.com/" target="_blank"></a>
                                </li>
                                <li>
                                    <a rel="nofollow" class="icon_google" href="http://plus.google.com/108593809997715530162/?rel=author" target="_blank"></a>
                                </li>
                            </ul>
                        </li>
                        <li class="div_mobile">
                            <div class="col_left">
                                <iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FOrder-System%2F517340378368864%3Fskip_nax_wizard%3Dtrue%26ref_type%3Dlogout_gear&amp;width=243&amp;height=235&amp;colorscheme=light&amp;show_faces=true&amp;header=false&amp;stream=false&amp;show_border=true" scrolling="no" frameborder="0" style="border: none; overflow: hidden; width: 243px; height: 235px;" allowtransparency="true"></iframe>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <!--footer end-->
        <div id="footer" style="background-color: black">
            <div class="container">
                <!--<div class="footer_com">-->
                <div class="col-xs-12" style="padding: 0px; margin: 0px">
                    <div class="col-md-2" style="padding: 0px; margin: 0px">
                        <a class="logo_footer_red"></a>
                    </div>
                    <div class="col-md-6" style="padding: 0px; margin: 0px">
                        <div class="info_com">
                            <p class="name f_bold">Công ty Think2do</p>
                            <p class="info ">331 Nguyễn Trọng Tuyển, Phường 10, Q. Phú Nhuận, HCMC</p>
                            <p class="info ">Điện thoại: (08) 7305 6616 - Fax: (08) 3844 6316</p>
                            <p class="info">Email: ordersystem@thinktodo.net </p>
                            <p class="info ">Mã số doanh nghiệp: 0310426944</p>
                            
                            <p class="info_copy">© 2012 thinktodo.net . All Rights Reserved</p>
                            
                        </div>
                    </div>
                    
                    <div class="col-md-4" style="padding: 0px; margin: 0px">
                        <form id="idContactForm" method="post" action="">                      
                            <div class="form-group">
                                <input type="text" class="form-control" placeholder="Họ tên" name="ContactForm[name]" />
                            </div>
                            <div class="form-group">
                                <input type="email" class="form-control" placeholder="Địa chỉ email" name="ContactForm[email]" />
                            </div>
                            <div class="form-group">
                                <input type="text" class="form-control" placeholder="Tiêu đề" name="ContactForm[subject]" />
                            </div>
                            <div class="form-group" style="text-wrap: normal">
                                <input type="text" style="height: 50px" class="form-control" placeholder="Nội dung" name="ContactForm[message]"/>
                            </div>
                            <div class="form-group">
                                <button type="submit" name="register" class="btn btn-success">Gửi<span class="icon-arrow-right"></span></button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        
        <!--LoginModal Box-->
        <div id="loginModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
            <div class="modal-dialog modal-sm">
                <div class="modal-content">
                    <div class="modal-header panel-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="myModalLabel">Đăng nhập</h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <a href="javascript:loginFacebook();" class="btn btn-primary" style="width: 100%;">
                                <i class="fa fa-facebook-square"></i>&nbsp;&nbsp;Đăng nhập Facebook
                            </a>
                        </div>
                        <div class="form-group">
                            <div class="signup-or-separator">
                                <h6 class="text">Hoặc</h6>
                                <hr>
                            </div>
                        </div>
                        <form id="idLogin" method="post" 
                                data-bv-message="This value is not valid"
                                data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
                                data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
                                data-bv-feedbackicons-validating="glyphicon glyphicon-refresh"
                              >
                        <?php $form=$this->beginWidget('CActiveForm');?>
                            <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-user" style="font-size: 12px;"></i></span>
                                    <input type="text" class="form-control" placeholder="Tên đăng nhập" 
                                           name="LoginForm[username]"
                                           data-bv-notempty="true"
                                           data-bv-notempty-message="Họ tên không được bỏ trống"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-lock"></i></span>
                                    <input type="password" class="form-control" placeholder="Mật khẩu" 
                                           name="LoginForm[password]"
                                           data-bv-notempty="true"
                                           data-bv-notempty-message="Mật khẩu không được bỏ trống"/>
                                </div>
                            </div>                    
                            <div class="form-group">
                                <div class="text-left">
                                    <a href="#" data-toggle="modal" data-target="#forgotModal" aria-hidden="true" data-dismiss="modal">Quên mật khẩu?</a>
                                </div>
                            </div>
                            <div class="form-group">
                                <button style="width: 100%;" type="submit" name="login" class="btn btn-success">Login</button>
                            </div>
                            <?php echo $form->errorSummary($modellogin, '<strong>Please fix the errors on the form:</strong><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button><div class="alert alert-danger">', '</div>'); ?>   
                            <?php $this->endWidget(); ?>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <div class="text-left">
                            Chưa có tài khoản? <a href="#" data-toggle="modal" data-target="#registrationModal" aria-hidden="true" data-dismiss="modal"
                                                  >Đăng ký tại đây</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--idRegistration-->
        <div id="registrationModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
            <div class="modal-dialog modal-sm">
                <div class="modal-content">
                    <div class="modal-header panel-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="myModalLabel">Đăng ký</h4>
                    </div>
                    <div class="modal-body">
                        <form id="idRegistration" method="post">
                        <?php $form=$this->beginWidget('CActiveForm');?>
                            <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-users" style="font-size: 12px;"></i></span>
                                    <input type="text" class="form-control" name="RegisterForm[name]" placeholder="Họ Tên"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-mail-reply"></i></span>
                                    <input type="text" class="form-control" name="RegisterForm[email]" placeholder="Địa chỉ Email"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    <input type="text" class="form-control" name="RegisterForm[username]" placeholder="Tên đăng nhập"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-lock"></i></span>
                                    <input type="password" class="form-control" id="password" name="RegisterForm[password]" placeholder="Mật khẩu"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-lock"></i></span>
                                    <input type="password" class="form-control" name="RegisterForm[cpassword]" placeholder="Nhập lại mật khẩu"
                                           />
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-phone"></i></span>
                                    <input type="text" class="form-control" name="RegisterForm[mobile]" placeholder="Số điện thoại"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="input-group">
                                    <input type="checkbox" style="margin-top: 0px"class="checkbox-inline" name="RegisterForm[accept]" value="1"/>
                                    <span class="inline">I accept the <a href="#">User Agreement</a></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="text-left">
                                    <a href="#" data-toggle="modal" data-target="#forgotModal" aria-hidden="true" data-dismiss="modal">Quên mật khẩu?</a>
                                </div>
                            </div>
                            <div class="form-group">
                                <button style="width: 100%;" type="submit" name="login" class="btn btn-success">Đăng Ký</button>
                            </div>
                            <?php echo $form->errorSummary($modelregister, '<strong>Please fix the errors on the form:</strong><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button><div class="alert alert-danger">', '</div>'); ?>
                            <?php $this->endWidget(); ?>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <div class="text-left">
                            Đã có tài khoản? 
                            <a href="#" data-toggle="modal" data-target="#loginModal" aria-hidden="true" data-dismiss="modal"
                               >Đăng nhập tại đây</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--ForgotModal Box-->
        <div id="forgotModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
            <div class="modal-dialog modal-sm">
                <div class="modal-content">
                    <div class="modal-header panel-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="myModalLabel">Lấy lại mật khẩu</h4>
                    </div>
                    <div class="modal-body">
                        <form id="idForgot" method="post"
                              data-bv-message="This value is not valid"
                              data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
                              data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
                              data-bv-feedbackicons-validating="glyphicon glyphicon-refresh"
                              >
                        <?php $form=$this->beginWidget('CActiveForm');?>
                            <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-mail-reply"></i></span>
                                    <input type="text" class="form-control" name="ForgotForm[email]" placeholder="Địa chỉ Email"
                                           data-bv-notempty="true"
                                           data-bv-notempty-message="The first name is required and cannot be empty" 
                                           data-bv-emailaddress="true"
                                           data-bv-emailaddress-message="The input is not a valid email address"
                                           />
                                </div>
                            </div>                    
                            <div class="form-group">
                                <button style="width: 100%;" type="submit" name="login" class="btn btn-success">Login</button>
                            </div>
                            <?php echo $form->errorSummary($modelforgot, '<strong>Please fix the errors on the form:</strong><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button><div class="alert alert-danger">', '</div>'); ?>   
                            <?php $this->endWidget(); ?>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <div class="text-left">
                            Chưa có tài khoản? <a href="#" data-toggle="modal" data-target="#registrationModal" aria-hidden="true" data-dismiss="modal"
                                                  >Đăng ký tại đây</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!--<div id="error-Modal" style="display: none">-->
        <div id="errorModal" class="alert alert-danger" tabindex="-1" role="dialog" aria-hidden="true" style="display: none">
            <strong>Please fix the errors on the form:</strong>
            <button type="button" class="close" data-dismiss="alert">
                <span aria-hidden="true">×</span>
                <span class="sr-only">Close</span>
            </button>
            <ul>
                        <?php $form=$this->beginWidget('CActiveForm');?>
                <li><?php echo $form->error($modellogin,'username');?></li>  
                <li><?php echo $form->error($modellogin,'password');?></li>  
                <li><?php echo $form->error($modelregister,'username');?></li>
                <li><?php echo $form->error($modelforgot,'email');?></li> 
                        <?php $this->endWidget(); ?>
            </ul>
        </div>
        <!--</div>-->
        
        <!--back to top-->
        <div id="topcontrol" style="position: fixed; bottom: 5px; right: 5px; opacity: 1; cursor: pointer; left: 90%; display: none; margin-left: -5px" class="top_control" title="Trở về đầu trang">
            <a class="btn_top" href="#top"></a>
            <!--<a href="javascript:;" class="btn_down"></a>-->
        </div>
                <?php if ( $form->error($modellogin,'username') || $form->error($modellogin,'password') || $form->error($modelregister,'username')) {
                    echo "<script type='text/javascript'>alert('Có lỗi xảy ra. Vui lòng xem lại thao tác trước đó');</script>";
                }        ?>
        
        <script type="text/javascript">       
            $(document).ready(function() {
                $("#idContactForm").bootstrapValidator({
                    message: 'This value is not valid',
                    feedbackIcons: {
                        valid: 'glyphicon glyphicon-ok',
                        invalid: 'glyphicon glyphicon-remove',
                        validating: 'glyphicon glyphicon-refresh'
                    },
                    fields: {
                        'ContactForm[name]': {
                            validators: {
                                notEmpty: {
                                    message: 'The name is required'
                                }
                            }
                        },
                        'ContactForm[email]': {
                            validators: {
                                notEmpty: {
                                    message: 'The email address is required and cannot be empty'
                                },
                                emailAddress: {
                                    message: 'The email address is not a valid'
                                }
                            }
                        },
                        'ContactForm[subject]': {
                            validators: {
                                notEmpty: {
                                    message: 'The subject is required'
                                }
                            }
                        },
                        'ContactForm[message]': {
                            validators: {
                                notEmpty: {
                                    message: 'The message is required'
                                },
                                stringLength: {
                                    min: 30,
                                    max: 100,
                                    message: 'The message must be more than 30 and less than 1000 characters long'
                                },
                            }
                        },
                    }
                });
                $("#idLogin").bootstrapValidator();
                $("#idForgot").bootstrapValidator();
                $("#idRegistration").bootstrapValidator({
                    feedbackIcons: {
                        valid: 'glyphicon glyphicon-ok',
                        invalid: 'glyphicon glyphicon-remove',
                        validating: 'glyphicon glyphicon-refresh'
                    },
                    fields: {
                        'RegisterForm[username]': {
                            message: 'The username is not valid',
                            validators: {
                                notEmpty: {
                                    message: 'The username is required and cannot be empty'
                                },
                                stringLength: {
                                    min: 6,
                                    max: 30,
                                    message: 'The username must be more than 6 and less than 30 characters long'
                                },
                                regexp: {
                                    regexp: /^[a-zA-Z0-9]+$/,
                                    message: 'The username can only consist of alphabetical and number'
                                },
                                different: {
                                    field: 'RegisterForm[password]',
                                    message: 'The username and password cannot be the same as each other'
                                }
                            }
                        },
                        'RegisterForm[email]': {
                            validators: {
                                notEmpty: {
                                    message: 'The email address is required and cannot be empty'
                                },
                                emailAddress: {
                                    message: 'The email address is not a valid'
                                }
                            }
                        },
                        'RegisterForm[password]': {
                            validators: {
                                notEmpty: {
                                    message: 'The password is required and cannot be empty'
                                },
                                different: {
                                    field: 'RegisterForm[username]',
                                    message: 'The password cannot be the same as username'
                                },
                                stringLength: {
                                    min: 6,
                                    message: 'The password must have at least 6 characters'
                                }
                            }
                        },
                        'RegisterForm[cpassword]': {
                            validators: {
                                notEmpty: {
                                    message: 'The password is required and cannot be empty'
                                },
                                identical: {
                                    field: 'RegisterForm[password]',
                                    message: 'The password and its confirm are not the same'
                                },
                            }
                        },
                        'RegisterForm[name]': {
                            message: 'The name is not valid',
                            validators: {
                                notEmpty: {
                                    message: 'The name is required and cannot be empty'
                                },
                                stringLength: {
                                    min: 6,
                                    max: 30,
                                    message: 'The name must be more than 6 and less than 30 characters long'
                                },
                                //                    regexp: {
                                //                        regexp: /^[a-zA-Z0-9]+$/,
                                //                        message: 'The name can only consist of alphabetical and number'
                                //                    },
                                different: {
                                    field: 'RegisterForm[password]',
                                    message: 'The name and password cannot be the same as each other'
                                }
                            }
                        },
                        'RegisterForm[mobile]': {
                            message: 'The mobile is not valid',
                            validators: {
                                notEmpty: {
                                    message: 'The mobile is required and cannot be empty'
                                },
                                stringLength: {
                                    min: 6,
                                    max: 30,
                                    message: 'The mobile must be more than 6 and less than 30 characters long'
                                },
                                digits: {
                                    message: 'The phone number can contain digits only'
                                },
                            }
                        },
                        'RegisterForm[accept]':{
                            messages: 'The License is not valid',
                            validators: {
                                notEmpty: {
                                    messages: 'The License is required'
                                }
                            }
                        }
                    }
                });
                $("#idSearch").bootstrapValidator({
                    message: 'This value is not valid',
                    feedbackIcons: {
                        valid: 'glyphicon glyphicon-ok',
                        invalid: 'glyphicon glyphicon-remove',
                        validating: 'glyphicon glyphicon-refresh'
                    },
                    fields: {
                        'city': {
                            validators: {
//                                notEmpty: {
//                                    messages: 'The City is required'
//                                },
//                               greatherThan: {
//                                   value: 1
//                               }
                                 between: {
                                     min: 1,
                                     max: 2,
                                     message: 'The City is required'
                    }
                            }
                        }
                    }
                })
            });
        </script>
        <script type="text/javascript">
            $(document).ready(function () {
                $('iframe').attr('display', 'none');
            });
        </script>
    </body>
</html>
